﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HZ.Supervise.Model;
using System.Text;
using HZ.Supervise.IBLL;

namespace HZ.Supervise.Web.Common
{
	public partial class FindAllArea1 : BasePage
	{
		//string[] aid;
		protected void Page_Load(object sender, EventArgs e)
		{



		}

		/// <summary>
		/// 数据绑定
		/// </summary>
		private void dataBind()
		{
			int i;

			HZ.Supervise.IBLL.IBLL_Area area = HZ.Supervise.BLLFactory.IBLL_Area();

			string a = CurrentAccount.GetUser().Org.Area.AreaID;

			IList<Model.Area> list = area.GetSonAreas(CurrentAccount.GetUser().Org.Area.AreaID, 1, 0, out i);

		}


		/// <summary>
		/// 绑定List控件集合
		/// </summary>
		private void bindList()
		{
			string[] hosName = this.AreaName.Value.Split(',');
			string[] hosId = this.AreaId.Value.Split(',');
			this.ListArea.Items.Clear();
			for (int i = 0; i < hosName.Length; i++)
			{
				if (hosName[i].Equals(""))
				{
					return;
				}
				ListItem item = new ListItem();
				item.Text = hosName[i];
				item.Value = hosId[i];
				this.ListArea.Items.Add(item);
			}
		}
		/// <summary>
		/// 曹鹏
		/// 2011年5月17日16:39:44
		/// 拼接查询条件
		/// </summary>
		/// <returns></returns>
		protected string GetAreaId()
		{

			string where = "";

			string areaid = CurrentAccount.GetUser().Org.Area.AreaID;

			if (areaid != Constants.CURRENT_DEPLOY_AREAID)
			{

				if (areaid.Substring(4, 2).Equals("00"))
				{

					where += " and AreaId like '" + areaid.Substring(0, 4) + "%'";

				}
				else
				{

					where += " and AreaId = '" + areaid + "'";

				}
			}
			else
			{
                where += " and AreaId like '22%'";
			}

			return HttpUtility.UrlEncode(where);

		}

		//public void Bind()
		//{
		//    SuperviseQuery sq = new SuperviseQuery();
		//    StringBuilder strid = new StringBuilder();;
		//    foreach (string item in aid)
		//    {
		//        if (!string.IsNullOrEmpty(item))
		//        {
		//            ListBox lb = new ListBox();

		//            if (lb.Text == "%市")
		//            {
		//                strid.Append(" AreaId  like '" + item.Substring(0, 4) + "%' or ");
		//            }
		//            else
		//            {
		//                strid.Append(" AreaId  =" + item + " or ");

		//            }
		//        }
		//    }
		//}
	}
}
